package com.ytktt.study.week5.task1;

import com.ytktt.study.week5.task1.proxy.HelloServiceCglibProxy;
import com.ytktt.study.week5.task1.proxy.HelloServiceJdkProxy;
import com.ytktt.study.week5.task1.service.HelloService;
import com.ytktt.study.week5.task1.service.impl.HelloServiceImpl;

/**
 * TODO
 *
 * @author ytk
 */
public class Application {

    public static void main(String[] args) {
        HelloServiceJdkProxy jdkProxy = new HelloServiceJdkProxy();
        HelloService helloService1 = (HelloService) jdkProxy.bind(new HelloServiceImpl());
        helloService1.sayHello("jdk dynamic");

        System.out.println("\n======================\n");

        HelloServiceCglibProxy cglibProxy = new HelloServiceCglibProxy();
        HelloService helloService2 = (HelloService) cglibProxy.bind(new HelloServiceImpl());
        helloService2.sayHello("cglib");
    }
}
